

<!DOCTYPE html>
<html class="writer-html5" lang="en" >
<head>
  <meta charset="utf-8" />
  
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  
  <title>手动安装 ceph-iscsi &mdash; Ceph Documentation</title>
  

  
  <link rel="stylesheet" href="../../_static/ceph.css" type="text/css" />
  <link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
  <link rel="stylesheet" href="../../_static/graphviz.css" type="text/css" />
  <link rel="stylesheet" href="../../_static/css/custom.css" type="text/css" />

  
  
    <link rel="shortcut icon" href="../../_static/favicon.ico"/>
  

  
  

  

  
  <!--[if lt IE 9]>
    <script src="../../_static/js/html5shiv.min.js"></script>
  <![endif]-->
  
    
      <script type="text/javascript" id="documentation_options" data-url_root="../../" src="../../_static/documentation_options.js"></script>
        <script src="../../_static/jquery.js"></script>
        <script src="../../_static/underscore.js"></script>
        <script src="../../_static/doctools.js"></script>
    
    <script type="text/javascript" src="../../_static/js/theme.js"></script>

    
    <link rel="index" title="Index" href="../../genindex/" />
    <link rel="search" title="Search" href="../../search/" />
    <link rel="next" title="块设备入门" href="../../start/quick-rbd/" />
    <link rel="prev" title="用命令行配置 iSCSI Target" href="../iscsi-target-cli/" /> 
</head>

<body class="wy-body-for-nav">

   
  <header class="top-bar">
    

















<div role="navigation" aria-label="breadcrumbs navigation">

  <ul class="wy-breadcrumbs">
    
      <li><a href="../../" class="icon icon-home"></a> &raquo;</li>
        
          <li><a href="../">Ceph 块设备</a> &raquo;</li>
        
          <li><a href="../rbd-integrations/">Ceph 块设备与第三方对接</a> &raquo;</li>
        
          <li><a href="../iscsi-overview/">Ceph iSCSI Gateway</a> &raquo;</li>
        
          <li><a href="../iscsi-targets/">iSCSI Targets</a> &raquo;</li>
        
          <li><a href="../iscsi-target-cli/">用命令行配置 iSCSI Target</a> &raquo;</li>
        
      <li>手动安装 ceph-iscsi</li>
    
    
      <li class="wy-breadcrumbs-aside">
        
          
            <a href="../../_sources/rbd/iscsi-target-cli-manual-install.rst.txt" rel="nofollow"> View page source</a>
          
        
      </li>
    
  </ul>

  
  <hr/>
</div>
  </header>
  <div class="wy-grid-for-nav">
    
    <nav data-toggle="wy-nav-shift" class="wy-nav-side">
      <div class="wy-side-scroll">
        <div class="wy-side-nav-search"  style="background: #eee" >
          

          
            <a href="../../">
          

          
            
            <img src="../../_static/logo.png" class="logo" alt="Logo"/>
          
          </a>

          

          
<div role="search">
  <form id="rtd-search-form" class="wy-form" action="../../search/" method="get">
    <input type="text" name="q" placeholder="Search docs" />
    <input type="hidden" name="check_keywords" value="yes" />
    <input type="hidden" name="area" value="default" />
  </form>
</div>

          
        </div>

        
        <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
          
            
            
              
            
            
              <ul class="current">
<li class="toctree-l1"><a class="reference internal" href="../../start/intro/">Ceph 简介</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../install/">安装 Ceph</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../cephadm/">Cephadm</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../rados/">Ceph 存储集群</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../cephfs/">Ceph 文件系统</a></li>
<li class="toctree-l1 current"><a class="reference internal" href="../">Ceph 块设备</a><ul class="current">
<li class="toctree-l2"><a class="reference internal" href="../rados-rbd-cmds/">基本命令</a></li>
<li class="toctree-l2"><a class="reference internal" href="../rbd-operations/">运维</a></li>
<li class="toctree-l2 current"><a class="reference internal" href="../rbd-integrations/">对接</a><ul class="current">
<li class="toctree-l3"><a class="reference internal" href="../rbd-ko/">内核模块</a></li>
<li class="toctree-l3"><a class="reference internal" href="../qemu-rbd/">QEMU</a></li>
<li class="toctree-l3"><a class="reference internal" href="../libvirt/">libvirt</a></li>
<li class="toctree-l3"><a class="reference internal" href="../rbd-kubernetes/">Kubernetes</a></li>
<li class="toctree-l3"><a class="reference internal" href="../rbd-nomad/">Nomad</a></li>
<li class="toctree-l3"><a class="reference internal" href="../rbd-openstack/">OpenStack</a></li>
<li class="toctree-l3"><a class="reference internal" href="../rbd-cloudstack/">CloudStack</a></li>
<li class="toctree-l3 current"><a class="reference internal" href="../iscsi-overview/">LIO iSCSI Gateway</a><ul class="current">
<li class="toctree-l4"><a class="reference internal" href="../iscsi-requirements/">Requirements</a></li>
<li class="toctree-l4 current"><a class="reference internal" href="../iscsi-targets/">Configuring the iSCSI Target</a></li>
<li class="toctree-l4"><a class="reference internal" href="../iscsi-initiators/">Configuring the iSCSI Initiators</a></li>
<li class="toctree-l4"><a class="reference internal" href="../iscsi-monitoring/">Monitoring the iSCSI Gateways</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="../rbd-windows/">Windows</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="../man/">手册页</a></li>
<li class="toctree-l2"><a class="reference internal" href="../api/">APIs</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../../radosgw/">Ceph 对象网关</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../mgr/">Ceph 管理器守护进程</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../mgr/dashboard/">Ceph 仪表盘</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../api/">API 文档</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../architecture/">体系结构</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../dev/developer_guide/">开发者指南</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../dev/internals/">Ceph 内幕</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../governance/">项目管理</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../foundation/">Ceph 基金会</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../ceph-volume/">ceph-volume</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../releases/general/">Ceph 版本（总目录）</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../releases/">Ceph 版本（索引）</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../security/">Security</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../glossary/">Ceph 术语</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../jaegertracing/">Tracing</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../translation_cn/">中文版翻译资源</a></li>
</ul>

            
          
        </div>
        
      </div>
    </nav>

    <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">

      
      <nav class="wy-nav-top" aria-label="top navigation">
        
          <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
          <a href="../../">Ceph</a>
        
      </nav>


      <div class="wy-nav-content">
        
        <div class="rst-content">
        
          <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
           <div itemprop="articleBody">
            
<div id="dev-warning" class="admonition note">
  <p class="first admonition-title">Notice</p>
  <p class="last">This document is for a development version of Ceph.</p>
</div>
  <div id="docubetter" align="right" style="padding: 5px; font-weight: bold;">
    <a href="https://pad.ceph.com/p/Report_Documentation_Bugs">Report a Documentation Bug</a>
  </div>

  
  <div class="section" id="ceph-iscsi">
<h1>手动安装 ceph-iscsi<a class="headerlink" href="#ceph-iscsi" title="Permalink to this headline">¶</a></h1>
<p><strong>Requirements</strong></p>
<p>To complete the installation of ceph-iscsi, there are 4 steps:</p>
<ol class="arabic simple">
<li><p>Install common packages from your Linux distribution’s software repository</p></li>
<li><p>Install Git to fetch the remaining packages directly from their Git repositories</p></li>
<li><p>Ensure a compatible kernel is used</p></li>
<li><p>Install all the components of ceph-iscsi and start associated daemons:</p>
<ul class="simple">
<li><p>tcmu-runner</p></li>
<li><p>rtslib-fb</p></li>
<li><p>configshell-fb</p></li>
<li><p>targetcli-fb</p></li>
<li><p>ceph-iscsi</p></li>
</ul>
</li>
</ol>
<div class="section" id="install-common-packages">
<h2>1. Install Common Packages<a class="headerlink" href="#install-common-packages" title="Permalink to this headline">¶</a></h2>
<p>The following packages will be used by ceph-iscsi and target tools.
They must be installed from your Linux distribution’s software repository
on each machine that will be a iSCSI gateway:</p>
<ul class="simple">
<li><p>libnl3</p></li>
<li><p>libkmod</p></li>
<li><p>librbd1</p></li>
<li><p>pyparsing</p></li>
<li><p>python kmod</p></li>
<li><p>python pyudev</p></li>
<li><p>python gobject</p></li>
<li><p>python urwid</p></li>
<li><p>python pyparsing</p></li>
<li><p>python rados</p></li>
<li><p>python rbd</p></li>
<li><p>python netifaces</p></li>
<li><p>python crypto</p></li>
<li><p>python requests</p></li>
<li><p>python flask</p></li>
<li><p>pyOpenSSL</p></li>
</ul>
</div>
<div class="section" id="install-git">
<h2>2. Install Git<a class="headerlink" href="#install-git" title="Permalink to this headline">¶</a></h2>
<p>In order to install all the packages needed to run iSCSI with Ceph, you need to download them directly from their repository by using Git.
On CentOS/RHEL execute:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><style type="text/css">
span.prompt1:before {
  content: "> ";
}
</style><span class="prompt1">sudo yum install git</span>
</pre></div></div><p>On Debian/Ubuntu execute:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span class="prompt1">sudo apt install git</span>
</pre></div></div><p>To know more about Git and how it works, please, visit <a class="reference external" href="https://git-scm.com">https://git-scm.com</a></p>
</div>
<div class="section" id="ensure-a-compatible-kernel-is-used">
<h2>3. Ensure a compatible kernel is used<a class="headerlink" href="#ensure-a-compatible-kernel-is-used" title="Permalink to this headline">¶</a></h2>
<p>Ensure you use a supported kernel that contains the required Ceph iSCSI patches:</p>
<ul class="simple">
<li><p>all Linux distribution with a kernel v4.16 or newer, or</p></li>
<li><p>Red Hat Enterprise Linux or CentOS 7.5 or later (in these distributions ceph-iscsi support is backported)</p></li>
</ul>
<p>If you are already using a compatible kernel, you can go to next step.
However, if you are NOT using a compatible kernel then check your distro’s
documentation for specific instructions on how to build this kernel. The only
Ceph iSCSI specific requirements are that the following build options must be
enabled:</p>
<blockquote>
<div><div class="highlight-ini notranslate"><div class="highlight"><pre><span></span><span class="na">CONFIG_TARGET_CORE</span><span class="o">=</span><span class="s">m</span>
<span class="na">CONFIG_TCM_USER2</span><span class="o">=</span><span class="s">m</span>
<span class="na">CONFIG_ISCSI_TARGET</span><span class="o">=</span><span class="s">m</span>
</pre></div>
</div>
</div></blockquote>
</div>
<div class="section" id="install-ceph-iscsi">
<h2>4. Install ceph-iscsi<a class="headerlink" href="#install-ceph-iscsi" title="Permalink to this headline">¶</a></h2>
<p>Finally, the remaining tools can be fetched directly from their Git repositories and their associated services started</p>
<div class="section" id="tcmu-runner">
<h3>tcmu-runner<a class="headerlink" href="#tcmu-runner" title="Permalink to this headline">¶</a></h3>
<blockquote>
<div><p>Installation:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span class="prompt1">git clone https://github.com/open-iscsi/tcmu-runner</span>
<span class="prompt1"><span class="nb">cd</span> tcmu-runner</span>
</pre></div></div><p>Run the following command to install all the needed dependencies:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span class="prompt1">./extra/install_dep.sh</span>
</pre></div></div><p>Now you can build the tcmu-runner.
To do so, use the following build command:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span class="prompt1">cmake -Dwith-glfs<span class="o">=</span><span class="nb">false</span> -Dwith-qcow<span class="o">=</span><span class="nb">false</span> -DSUPPORT_SYSTEMD<span class="o">=</span>ON -DCMAKE_INSTALL_PREFIX<span class="o">=</span>/usr</span>
<span class="prompt1">make install</span>
</pre></div></div><p>Enable and start the daemon:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span class="prompt1">systemctl daemon-reload</span>
<span class="prompt1">systemctl <span class="nb">enable</span> tcmu-runner</span>
<span class="prompt1">systemctl start tcmu-runner</span>
</pre></div></div></div></blockquote>
</div>
<div class="section" id="rtslib-fb">
<h3>rtslib-fb<a class="headerlink" href="#rtslib-fb" title="Permalink to this headline">¶</a></h3>
<blockquote>
<div><p>Installation:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span class="prompt1">git clone https://github.com/open-iscsi/rtslib-fb.git</span>
<span class="prompt1"><span class="nb">cd</span> rtslib-fb</span>
<span class="prompt1">python setup.py install</span>
</pre></div></div></div></blockquote>
</div>
<div class="section" id="configshell-fb">
<h3>configshell-fb<a class="headerlink" href="#configshell-fb" title="Permalink to this headline">¶</a></h3>
<blockquote>
<div><p>Installation:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span class="prompt1">git clone https://github.com/open-iscsi/configshell-fb.git</span>
<span class="prompt1"><span class="nb">cd</span> configshell-fb</span>
<span class="prompt1">python setup.py install</span>
</pre></div></div></div></blockquote>
</div>
<div class="section" id="targetcli-fb">
<h3>targetcli-fb<a class="headerlink" href="#targetcli-fb" title="Permalink to this headline">¶</a></h3>
<blockquote>
<div><p>Installation:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span class="prompt1">git clone https://github.com/open-iscsi/targetcli-fb.git</span>
<span class="prompt1"><span class="nb">cd</span> targetcli-fb</span>
<span class="prompt1">python setup.py install</span>
<span class="prompt1">mkdir /etc/target</span>
<span class="prompt1">mkdir /var/target</span>
</pre></div></div><div class="admonition warning">
<p class="admonition-title">Warning</p>
<p>The ceph-iscsi tools assume they are managing all targets
on the system. If targets have been setup and are being managed by
targetcli the target service must be disabled.</p>
</div>
</div></blockquote>
</div>
<div class="section" id="id1">
<h3>ceph-iscsi<a class="headerlink" href="#id1" title="Permalink to this headline">¶</a></h3>
<blockquote>
<div><p>Installation:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span class="prompt1">git clone https://github.com/ceph/ceph-iscsi.git</span>
<span class="prompt1"><span class="nb">cd</span> ceph-iscsi</span>
<span class="prompt1">python setup.py install --install-scripts<span class="o">=</span>/usr/bin</span>
<span class="prompt1">cp usr/lib/systemd/system/rbd-target-gw.service /lib/systemd/system</span>
<span class="prompt1">cp usr/lib/systemd/system/rbd-target-api.service /lib/systemd/system</span>
</pre></div></div><p>Enable and start the daemon:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span class="prompt1">systemctl daemon-reload</span>
<span class="prompt1">systemctl <span class="nb">enable</span> rbd-target-gw</span>
<span class="prompt1">systemctl start rbd-target-gw</span>
<span class="prompt1">systemctl <span class="nb">enable</span> rbd-target-api</span>
<span class="prompt1">systemctl start rbd-target-api</span>
</pre></div></div></div></blockquote>
<p>Installation is complete. Proceed to the setup section in the
<a class="reference external" href="../iscsi-target-cli">main ceph-iscsi CLI page</a>.</p>
</div>
</div>
</div>



           </div>
           
          </div>
          <footer>
    <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
        <a href="../../start/quick-rbd/" class="btn btn-neutral float-right" title="块设备入门" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
        <a href="../iscsi-target-cli/" class="btn btn-neutral float-left" title="用命令行配置 iSCSI Target" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
    </div>

  <hr/>

  <div role="contentinfo">
    <p>
        &#169; Copyright 2016, Ceph authors and contributors. Licensed under Creative Commons Attribution Share Alike 3.0 (CC-BY-SA-3.0).

    </p>
  </div> 

</footer>
        </div>
      </div>

    </section>

  </div>
  

  <script type="text/javascript">
      jQuery(function () {
          SphinxRtdTheme.Navigation.enable(true);
      });
  </script>

  
  
    
   

</body>
</html>